|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnegotiator.utility.UtilitySpace
public class UtilitySpace
Wouter: the utility space couples all objectives to weights and evaluators. A utilityspace currently is not bound to one agent. I can see some security issues with that... Wouter: this class is final to prevent users (students) to override the getUtility function with their own version of UtilitySpace Wouter 15nov: un-done the final, students may hack what they want, but they work with a copy anyway.
| Constructor Summary | |
|---|---|
UtilitySpace()
Creates an empty utility space. |
|
UtilitySpace(Domain domain)
Creates a new utilityspace of the given domain. |
|
UtilitySpace(Domain domain,
java.lang.String fileName)
Create new default util space for a given domain. |
|
UtilitySpace(UtilitySpace us)
Copies the data from another UtilitySpace. |
|
| Method Summary | |
|---|---|
Evaluator |
addEvaluator(Objective obj)
Adds an evaluator to an objective or issue |
Evaluator |
addEvaluator(Objective obj,
Evaluator ev)
Sets an |
void |
checkReadyForNegotiation(Domain dom)
check if this utility space is ready for negotiation. |
Evaluator |
DefaultEvaluator(Objective obj)
create a default evaluator for a given Objective. |
static double |
discount(double util,
double time,
double discountFactor)
Computes: discountedUtil = util * Math.pow(discount, time). |
boolean |
equals(java.lang.Object obj)
|
double |
getDiscountFactor()
|
Domain |
getDomain()
|
double |
getEvaluation(int pIssueIndex,
Bid bid)
Returns the utility of one issue in the bid. |
Evaluator |
getEvaluator(int index)
|
java.util.Set<java.util.Map.Entry<Objective,Evaluator>> |
getEvaluators()
|
java.lang.String |
getFileName()
|
Objective |
getIssue(int index)
Deprecated. Use getObjective |
Bid |
getMaxUtilityBid()
Totally revised, brute-force search now. |
Bid |
getMinUtilityBid()
Returns the the worst bid. |
int |
getNrOfEvaluators()
|
Objective |
getObjective(int index)
Returns the Objective or Issue at that index |
java.lang.Double |
getReservationValue()
The reservation value is the least favourable point at which one will accept a negotiated agreement. |
double |
getReservationValueUndiscounted()
Equivalent to getReservationValue(), but always returns a double value. |
double |
getReservationValueWithDiscount(double time)
The discounted version of getReservationValue(). |
double |
getReservationValueWithDiscount(Timeline timeline)
The discounted version of getReservationValue(). |
double |
getUtility(Bid bid)
|
double |
getUtilityWithDiscount(Bid bid,
double time)
|
double |
getUtilityWithDiscount(Bid bid,
long timeAfterStart,
long deadline)
Deprecated. |
double |
getUtilityWithDiscount(Bid bid,
Timeline timeline)
Let d in (0, 1) be the discount factor. |
double |
getWeight(int issueID)
|
negotiator.xml.SimpleElement |
getXMLRoot()
|
java.lang.String |
IsComplete()
Wouter: this function *should* check that the domainSubtreeP is a subtree of the utilSubtreeP, and that all leaf nodes are complete. |
boolean |
lock(Objective obj)
Place a lock on the weight of an objective or issue. |
java.util.Set<java.util.Map.Entry<Objective,Evaluator>> |
normalizeChildren(Objective obj)
Normalizes the weights of objectives of the given objective so that they sum up to one. |
boolean |
removeEvaluator(Objective obj)
Removes an evaluator. |
void |
setDiscount(double newDiscount)
|
void |
setReservationValue(double newRV)
|
double |
setWeight(Objective objective,
double weight)
Method used to set the weight of the given objective. |
void |
setWeightSimple(Objective objective,
double weight)
Method which sets the weight of an issue without checking normalization. |
negotiator.xml.SimpleElement |
toXML()
Creates an xml representation (in the form of a SimpleElements) of the utilityspace. |
boolean |
unlock(Objective obj)
Clear a lock on the weight of an objective or issue. |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UtilitySpace()
public UtilitySpace(Domain domain)
domain - for which the utilityspace should be specified.
public UtilitySpace(Domain domain,
java.lang.String fileName)
throws java.lang.Exception
domain - fileName - to read domain from.
Set fileName to "" if no file available, in which case default evaluators are loaded..
java.lang.Exception - if error occurs, e.g. if domain does not match the util space, or file not found.public UtilitySpace(UtilitySpace us)
us - utilityspace to be cloned.| Method Detail |
|---|
public Evaluator DefaultEvaluator(Objective obj)
obj - the objective to create an evaluator for
public void checkReadyForNegotiation(Domain dom)
throws java.lang.Exception
dom - is the domain in which nego is taking place
java.lang.Exception - if utility space is incomplete (@see isComplete());public negotiator.xml.SimpleElement getXMLRoot()
public final int getNrOfEvaluators()
public final Evaluator getEvaluator(int index)
index - The IDnumber of the Objective or Issue
public double getUtility(Bid bid)
throws java.lang.Exception
bid - of which we are interested in its utility.
java.lang.Exception - when bid is incomplete or invalid.
@Deprecated
public double getUtilityWithDiscount(Bid bid,
long timeAfterStart,
long deadline)
throws java.lang.Exception
bid - timeAfterStart - deadline -
java.lang.Exception
public double getUtilityWithDiscount(Bid bid,
Timeline timeline)
Timeline.
We compute the discounted utility discountedUtility as follows:
discountedUtility = originalUtility * d^t.
For t = 0 the utility remains unchanged, and for t = 1 the original utility is multiplied by the discount factor.
The effect is almost linear in between.
bid - of which we are interested in its utility.timeline - indicating the time passed in the negotiation.
public double getUtilityWithDiscount(Bid bid,
double time)
bid - of which we want to know the utility at the given time.time - at which we want to know the utility of the bid.
getUtilityWithDiscount(Bid, Timeline)
public static double discount(double util,
double time,
double discountFactor)
util - undiscounted utility.time - at which we want to know the discounted utility.discountFactor - of the preference profile.
public final double getEvaluation(int pIssueIndex,
Bid bid)
throws java.lang.Exception
pIssueIndex - of the issue.bid -
java.lang.Exception - if the bid or value is null.
public final Bid getMaxUtilityBid()
throws java.lang.Exception
java.lang.Exception - if there is no bid at all in this util space.
public Bid getMinUtilityBid()
throws java.lang.Exception
java.lang.Exception - if there is no bid at all in the util spacepublic double getWeight(int issueID)
issueID - The Issue or Objective to get the weight from
public void setWeightSimple(Objective objective,
double weight)
objective - of which the weights must be set.weight - to which the weight of the objective must be set.
public double setWeight(Objective objective,
double weight)
objective - of which the weights must be set.weight - to which the weight of the objective must be set.
public final Objective getIssue(int index)
index - The index of the issue to
public final Objective getObjective(int index)
index - The index of the Objective or Issue.
public final Domain getDomain()
public final Evaluator addEvaluator(Objective obj)
obj - The Objective or Issue to attach an Evaluator to.
public final Evaluator addEvaluator(Objective obj,
Evaluator ev)
obj - The Objective to attach an Evaluator to.ev - The Evaluator to attach.
public final java.util.Set<java.util.Map.Entry<Objective,Evaluator>> getEvaluators()
public final boolean lock(Objective obj)
obj - The objective or issue that is about to have it's weight locked.
true if succesfull, false If the objective doesn't have an evaluator yet.public final boolean unlock(Objective obj)
obj - The objective or issue that is having it's lock cleared.
true If the lock is cleared, false if the objective or issue doesn't have an evaluator yet.public final java.util.Set<java.util.Map.Entry<Objective,Evaluator>> normalizeChildren(Objective obj)
obj - of which the weights must be normalized.
public boolean removeEvaluator(Objective obj)
obj - to be removed.
public negotiator.xml.SimpleElement toXML()
null when there was an error.public java.lang.String IsComplete()
public void setReservationValue(double newRV)
newRV - new reservation value.public void setDiscount(double newDiscount)
newDiscount - new discount factor.public java.lang.Double getReservationValue()
getReservationValueWithDiscount(Timeline).
public double getReservationValueUndiscounted()
getReservationValue(), but always returns a double value. When the original reservation value is
null it returns the default value 0.
getReservationValue()public double getReservationValueWithDiscount(double time)
getReservationValue().
time - at which we want to know the utility of the reservation value.
public double getReservationValueWithDiscount(Timeline timeline)
getReservationValue().
timeline - specifying the current time in the negotiation.
public java.lang.String getFileName()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final double getDiscountFactor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||